<?php

/**
 * @Author: zhibinm (113664000@qq.com)
 * @Date:   2018-04-13 11:21:18 
 * @Copyright:   xuebingsi
 * @Last Modified by:   Zhibinm
 * @Last Modified time: 2018-04-14 07:52:56
 */
$data = file_get_contents('https://www.lagou.com/');

// 要操作的字符 串；源代码
// 
$preg = "/<a href=\"(https:\/\/www\.lagou\.com\/zhaopin\/.+?\/)\" data-lg-tj-id=\".+?\" data-lg-tj-no=\".+?\" data-lg-tj-cid=\".+?\">(.+?)<\/a>/";

$preg = "/data-lg-tj-cid=\"\d+?\">.+?<\/a>/";

$c = preg_match_all($preg,$data,$out);

var_dump($c);

var_dump($out);
// file_put_contents('./data1.txt',json_encode($out[1],JSON_UNESCAPED_UNICODE));



